import 'package:flutter/material.dart';

import '../r.dart';

class HelpPage extends StatefulWidget {
  @override
  HelpPageState createState() => new HelpPageState();
}

class HelpPageState extends State<HelpPage>
    with SingleTickerProviderStateMixin {
  TabController _tabController;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: TabBar(
          controller: _tabController,
          tabs: [
            Tab(text: "拼多多软件"),
            Tab(text: "微信商城"),
          ],
          labelColor: Colors.white,
        ),
      ),
      body: _buildCopyUrlBody(),
    );
  }

  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    _tabController = TabController(vsync: this, length: 2);
  }

  @override
  void dispose() {
    // TODO: implement dispose
    super.dispose();
    _tabController.dispose();
  }

  @override
  void didUpdateWidget(HelpPage oldWidget) {
    // TODO: implement didUpdateWidget
    super.didUpdateWidget(oldWidget);
  }

  @override
  void didChangeDependencies() {
    // TODO: implement didChangeDependencies
    super.didChangeDependencies();
  }

  Widget _buildCopyUrlBody() {
    return TabBarView(controller: _tabController, children: [
      Padding(
          padding: const EdgeInsets.all(10),
//          child: Flexible(
            child: ListView(
              children: <Widget>[
                Text(
                  "拼多多APP复制链接步骤如下：",
                  style: TextStyle(
                      fontSize: 16,
                      color: Colors.black,
                      fontWeight: FontWeight.w700),
                ),
                Image.asset(R.assetsImgPinApp),
                Text(
                  "链接复制成功之后，粘贴进入上面的输入框中，点击【生成有券链接】",
                  style: TextStyle(
                      fontSize: 16,
                      color: Colors.black,
                      fontWeight: FontWeight.w700),
                ),
              ],
//            ),
          )),
      Padding(
        padding: const EdgeInsets.all(10),
//        child: Flexible(
          child: ListView(
            children: <Widget>[
              Text(
                "拼多多APP复制链接步骤如下：",
                style: TextStyle(
                    fontSize: 16,
                    color: Colors.black,
                    fontWeight: FontWeight.w700),
              ),
              Image.asset(R.assetsImgPinWxShop),
              Text(
                "链接复制成功之后，粘贴进入上面的输入框中，点击【生成有券链接】",
                style: TextStyle(
                    fontSize: 16,
                    color: Colors.black,
                    fontWeight: FontWeight.w700),
              ),
            ],
          ),
//        ),
      ),
    ]);
  }
}
